﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using SixLottery.Helpers;
using System.Collections.Specialized;

namespace SixLottery.Common
{
    /// <summary>
    ///AdminPage 的摘要说明
    /// </summary>
    public class AdminPage : System.Web.UI.Page
    {
        public AdminPage()
        {
            HttpCookie cookie = HttpContext.Current.Request.Cookies["darrenbo"];
            bool isLogin = false;
            if (cookie == null)
            {
                isLogin = false;
            }
            else
            {
                try
                {
                    string value = SecurityHelper.DiscuzAuthcodeDecode(cookie.Value, SecurityHelper.Key);

                    isLogin = true;
                }
                catch (Exception)
                {
                    isLogin = false;
                }
            }

            if (isLogin == false)
            {
                HttpContext.Current.Response.Redirect("~/admin/login.aspx");
            }
        }
    } 
}